import { LoginWxMinSimple, getMemberProfile } from "@/http/profile";
export default {
    namespaced: true,
    state: {
        profile: null,
        memberProfile: null
    },
    getters: {},
    mutations: {
        setProfile(state, payload) {
            state.profile = payload
        },
        memberProfile(state, payload) {
            state.memberProfile = payload
        }
    },
    actions: {
        async fetchProfile(store, data) {
            const res = await LoginWxMinSimple(data)
            store.commit('setProfile', res.result)
        },
        async fetchMemberProfile(store) {
            const res = await getMemberProfile()
            store.commit('memberProfile', res.result)
            return res.result
        }

    }
}